import { request } from "@/utils/service"
import type * as Group from "./types/group"

/** 增/改 */
export function saveGroupDataApi(data: Group.CreateOrUpdateGroupRequestData) {
  return request({
    url: "group/save",
    method: "post",
    data
  })
}

/** 删 */
export function deleteGroupDataApi(id: number) {
  return request({
    url: `group/delete/${id}`,
    method: "post"
  })
}

/** 查 */
export function getGroupDataApi(params: Group.GroupRequestData) {
  return request<Group.GroupResponseData>({
    url: "group/list",
    method: "post",
    data: params
  })
}
